package SwitchTest;

import java.util.Scanner;

public class SwitchTest2 {
    public static void main(String[] args){
        Scanner s = new Scanner(System.in);
        System.out.println("请输入学生成绩：");
        int score = s.nextInt();
        int num = score / 10;
        String str = "";
        if(0 <=score && score <= 100){
            switch(num){
                case 9: case 10:
                    str = "优秀";
                    break;
                case 8:
                    str = "良好";
                    break;
                case 7:
                    str = "中等";
                    break;
                case 6:
                    str ="及格";
                    break;
                default:
                    str = "不及格";
            }
        }else{
            System.out.println("输入的成绩不合法！");
            return;
        }
        System.out.println("成绩等级为："+str);
    }
}
